package com.wn.service.impl;

import com.wn.dao.ManagerDao;
import com.wn.entity.Manager;
import com.wn.service.ManagerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
public class ManagerServiceImpl implements ManagerService {
    @Autowired
    private ManagerDao managerDao;

    @Override
    @Transactional
    public void addOne(Manager manager) {
        managerDao.addOne(manager);
    }

    @Override
    @Transactional
    public void deleteOne(Manager manager) {
        managerDao.deleteOne(manager.getId());
    }

    @Override
    @Transactional
    public void update(Manager manager) {
        managerDao.update(manager);
    }

    @Override
    public List<Manager> findAll() {
        return managerDao.findAll();
    }
}
